export default [
  {
    id: 'showqr',
    name: '显示连接二维码',
    type: 'system',
    exec: (app) => {
      const state = app.root.$store.state
      const code = state.env.customer.info.code
      const isOpen = state.remote.isOpen
      const hasLicense = state.cmlpanel.license.includes('remote')
      if (!isOpen || !hasLicense || !code) {
        app.actionServer.addInfo('WebSocket 已经关闭，无法显示二维码。')
        return
      }
      app.modal.open({
        code,
        componentsName: 'qr-image',
        type: 'success',
        style: {
          width: '400px'
        }
      })
      app.modal.isOpen = true
    }
  },
  {
    id: 'hideqr',
    name: '隐藏连接二维码',
    type: 'system',
    exec: (app) => {
      app.modal.destroy()
    }
  }
]
